package com.cloud.servicehi.Controller;

import com.cloud.commons.entry.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: setsun
 * @create: 2018- 08-13
 * @description:
 * @program: xiaoshan-cloud-lcc
 **/
@RestController
public class String_lcc_Controller {

    @Value("${server.port}")
    String port;


    @RequestMapping("/hi")
    public String home(@RequestParam(value = "name", defaultValue = "cloud") String name) {
        return "hi " + name + " ,i am from port:" + port;
    }

    @RequestMapping(value = "/lcc",method = RequestMethod.POST)
    @ResponseBody
    public Map<String, String> ceshi(@RequestBody User user) {
        System.out.println("lcc服务被调用"+user.getName());
        Map<String,String> map = new HashMap<>(16);
        map.put("name","lcc参数为: " + user.getName());
        return map;
    }

}
